#include "Cache/SingnalRedis.hh"
#include "Configuration.hh"

SingnalRedis* SingnalRedis::_instanceRedis = nullptr;

SingnalRedis* SingnalRedis::createRedis(){
        if(_instanceRedis == nullptr)
        {
            _instanceRedis = new SingnalRedis();
        }
        return _instanceRedis;
}


void SingnalRedis::destoryRedis(){
    if(_instanceRedis != nullptr){
        delete _instanceRedis;
        _instanceRedis = nullptr;
    }
}

Redis& SingnalRedis::getRedis(){
    return _redis;
}


SingnalRedis::SingnalRedis()
    : _redis(Configuration::createConfig()->getConfigMap()["redis"][0]){
}